﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Configuration;
using SPMS.Commons.Configuration.Xml;
using SPMS.Log.Repository;

namespace SPMS.Log.Configuration.Xml
{
    /// <summary>
    /// 日志配置节点处理器
    /// </summary>
    /// <remarks>处理对日志框架配置节的访问，用于将日志框架配置信息集成到应用程序或者站点配置文件中</remarks>
    /// <history>
    /// [zanezeng]               2009/10/14 11:12    创建
    /// </history>
    public sealed class LogConfigurationSectionHandler : IConfigurationSectionHandler
    {
        #region ---IConfigurationSectionHandler

        /// <summary>
        /// 创建日志框架配置节点处理器程序
        /// </summary>
        /// <param name="parent">父对象</param>
        /// <param name="configContext">配置上下文对象</param>
        /// <param name="section">节点的XML节点</param>
        /// <returns>创建的日志框架配置节处理程序对象</returns>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/14 11:14    创建
        /// </history>
        public object Create( object parent, object configContext, XmlNode section )
        {
            //创建配置对象
            XmlConfiguration configuration = new XmlConfiguration();

            //加载配置信息
            configuration.Load( section );

            //返回创建的配置信息
            return configuration;
        }

        #endregion
    }
}
